/*******************************************************************************
 *
 *      Filename: Plane.h
 *   Description: 
 *        Author: [kb]ypp
 *    Created at: November 7, 2005
 * Last modified: 
 *
 ******************************************************************************/

#ifndef PLANE_H
#define PLANE_H

#include "Vector3.h"

//! @brief Class to represent geometrical plane.
//!
//! Defined in terms of its unit normal vector n with components (A, B, C)
//! and D component from the plane equation:
//! @f[ Ax + By + Cz + D = 0 @f]
class Plane {
public:
	//! @brief Default constructor
	Plane();
	//! @brief Copy constructor
	Plane( const Plane &plane );
	//! @brief Construct the plane by its unit normal vector and D-component
	Plane( const vec3 &n, float d );
	
	//! @brief Assignment operator
	Plane& operator=( const Plane &plane );
	
	//! @brief Substitute the point into the plane equation
	float substitute( const vec3 &point ) const;
	
private:
	vec3 n; //!< Plane normal vector (with unit length)
	float d; //!< D-component
};

#endif // PLANE_H
